g13bcf
g13bcf
© Numerical Algorithms Group, 2002.
Purpose
G13BCF Multivariate time series, cross correlations
Synopsis
[s,r0,r,stat,ifail] = g13bcf(x,y,nl<,ifail>)
Description
Given two series x ,x ,...,x and y ,y ,...,y the routine
1 2 n 1 2 n
calculates the cross correlations between x and lagged values of
t
y :
t
n-l
-- _ _
> (x -x)(y -y)
-- t t+l
t=1
r (l)= ------------------ , l=0,1,...,L
xy ns s
x y
where
n
--
> x
-- t
_ t=1
x= ------
n
n
-- _ 2
> (x -x)
-- t
x t=1
s = -----------
n
and similarly for y.
The ratio of standard deviations s /s is also returned, and a
y x
portmanteau statistic is calculated:
L
-- 2
STAT=n > r (l) .
-- xy
i=1
Provided n is large, L much less than n, and both x ,y are
t t
samples of series whose true autocorrelation functions are zero,
then, under the null hypothesis that the true cross correlations
2
between the series are zero, STAT has a (chi) distribution with
L degrees of freedom. Values of STAT in the upper tail of this
distribution provide evidence against the null hypothesis.
Parameters
g13bcf
Required Input Arguments:
x (:) real
y (:) real
nl integer
Optional Input Arguments: <Default>
ifail integer -1
Output Arguments:
s real
r0 real
r (nl) real
stat real
ifail integer